package cn.csq.webfilter.controller;

import cn.csq.webfilter.config.Config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author csq
 * @version 1.0.0
 * @ClassName RestController.java
 * @Description TODO
 * @createTime 2021年12月30日 21:56:00
 */
@org.springframework.web.bind.annotation.RestController
@Slf4j
public class RestController {
    @Autowired
    private Config config;

    @PostMapping("/user/test")
    public String user() {
        return "suc";
    }

    @PostMapping("/user")
    public String filter() {
        return "filter success";
    }

    @PostMapping("/getUser")
    public String getUser() {
        log.info("config={}",config);
        String uesrname = config.getUesrname();
        log.info("username={}", uesrname);
        return uesrname;
    }
}
